﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Basics_ForLoop
{
    /// <summary>
    /// Author Joseph Gillies - stubblyone
    /// level: Beginner
    /// Problem: Print out a statement that counts from one to ten seperated by a comma
    /// Output: 1,2,3,4,5,6,7,8,9,10,
    /// </summary>
    class Program
    {
        //This is a very simple example of how to use a for loop
        static void Main(string[] args)
        {


            for (int i = 1; i <= 10; i++)// integer i equals 1; if it is less than or equal to ten; add one at a time until it gets to ten; 
            /*
             * i++ is a short way of writing i = i + 1
             * also rememeber computers start counting from 0 and not 1
             */
            {
                Console.Write("{0},", i);// print out 1,2,3,4,5,6,7,8,9,10,
                /*
                 * This will give the same outcome as Console.Write(i + ",");
                 * if you want to put the 1 - 10 on seperate lines use the WriteLine method instead of Write
                 */ 
            }
            Console.ReadKey();// Wait for a key press before closing the program
        }
    }
}
